package com.nbjtjc.safe.mapper.danger;

import com.nbjtjc.safe.model.danger.DangerInspectMember;
import com.nbjtjc.util.MyMapper;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface DangerInspectMemberMapper extends MyMapper<DangerInspectMember> {

    @Select("select danger_inspect_member.* ,sys_user.username as userName " +
            " from danger_inspect_member" +
            " left join sys_user on sys_user.user_id=danger_inspect_member.user_id" +
            " where inspect_table_public_id=#{ipId}")
    List<DangerInspectMember> findByInspectPublicId(@Param("ipId") int inspectPublicId);
    @Delete("delete from danger_inspect_member where inspect_table_public_id=#{ipId}")
    int deleteByInspectPublicId(@Param("ipId") int inspectPublicId );
}